{include file='admin/header.html'}
<span class="td4"> 

    <div class="botline"></div>
     <a href="{geturl route='addcategory'}" style="margin:5px 0 5px 0;display:block;"><img src="/images/add-category.png" /></a>
    <div class="botline"></div>
    <table class="tdzayavki">
        <thead>
            <tr> 
                <td class="tb1">
                    {if $sort=='name'}
                    <a href="?sort=name&order={if $order=='desc'}asc{else}desc{/if}" class="{$order}">Имя</a>
                    {else}
                    <a href="?sort=name&order={if $order=='desc'}asc{else}desc{/if}">Имя</a>
                    {/if}
                </td>
              
                <td class="tb5">Действие</td>
            </tr>
        </thead>

       {foreach from=$categories item=d}
        <tr id="tr_{$d->getId()}">
            <td class="nocontainer fs12" id="name_{$d->getId()}">
                 <a href="/category/{$d->getId()}" id="name_{$d->getId()}"> {$d->name}</a>
            
          

            <td>
                <a href="{geturl route='editcategory' id=$d->getId()}"><img src="/images/index-14.png" alt="Редактировать"></a>
                <a onclick="deletecategory({$d->getId()})" style="cursor: pointer"><img src="/images/index-07.png" alt="Удалить"></a>

            </td>

        </tr>
        {/foreach} 
    </table>
         <a href="{geturl route='addcategory'}" style="margin:5px 0 5px 0;display:block;"><img src="/images/add-category.png" /></a>
    <div class="botline"></div>
   {if $pages != 1}
   <div class="pages">
            {section loop=$pages name=page}
                {assign var=p value=$smarty.section.page.index_next}
                {if $p == $page}
                    <span>{$p}</span>
                {else}
                 {if $p==1}
                    <a href="{geturl action='categories'}">{$p}</a>
                    {else}
                     <a href="{geturl action='categories'}?p={$p}">{$p}</a>
                    {/if}
                
                {/if}
            {/section}
        </div>
   {/if}
</span> 

{include file='admin/footer.html'  menu="categories"}

